/*
    SDL - Simple DirectMedia Layer
    Copyright (C) 1997-2009 Sam Lantinga

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

    Sam Lantinga
    slouken@libsdl.org
*/

#ifndef SDL_cellpadmap_h
#define SDL_cellpadmap_h

#define							NUM_PADS	4			/* Maximum number of joysticks */
#define							NUM_BUTTONS	16			/* Number of buttons on each joystick */
#define							NUM_AXES	4			/* Number of axes on each joystick */

#ifndef CELL_NO_SOFT_INPUT
enum PadMode					{JOYSTICK, MOUSE, KEYBOARD};

typedef struct
{
	enum HID_ID					Buttons[16];
}	CELL_FixedMap;
#endif

typedef struct
{
	uint32_t					Open;
	uint32_t					OldButtons;
	uint32_t					OldAxes[4];
	SDL_Joystick*				Joystick;

#ifndef CELL_NO_SOFT_INPUT
	enum PadMode				Mode;
#endif
}	CELL_Pad;

typedef struct
{
	uint32_t					Nullify;			//Used for mode switches, ignore for app input
	int32_t						Joystick;			//Button number for joystick mode
#ifndef CELL_NO_SOFT_INPUT
	const CELL_OSK_Key*			Mapped;				//Mapped key
#endif
	uint32_t					Flags;				//1: Keydown event sent
#ifndef CELL_NO_SOFT_INPUT
	CELL_OverlayImage			Image;				//Image for OSK mode
	const CELL_OSK_Key*			RealMapped;
#endif
}	CELL_PadButton;

#endif


